<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #box{
      width: 150px;
      height: 150px;
      background-color: red;
      margin: 20px auto;
    }
  </style>
</head>
<body>
  <div id="box"></div>
  <script src="./hammer.js"></script>
  <script>
  var box=document.getElementById('box')
  var hammer=new Hammer(box)
  // console.log(hammer);
  // hammer.on('swipe pan tap doubletap press pinch rotate',function(e){
  //   console.log(e.type);
  // })
  hammer.on('swipeleft',function(){
    console.log('prev');
  })
  hammer.on('swiperight',function(){
    console.log('next');
  })
  </script>
</body>
</html>